package com.han.nettytestdemo.connector.netty.util;

import com.han.nettytestdemo.connector.ImsConnector;
import com.han.nettytestdemo.connector.communication.ProductCallback;
import com.han.nettytestdemo.connector.impl.ImsImpl;

public class ImsConnectorUtils {

    public ImsConnector imsConnector = new ImsImpl();//和固定列交互
    private volatile static ImsConnectorUtils instance = null;

    public static ImsConnectorUtils getInstance() {
        if (instance == null) {
            synchronized (ImsConnectorUtils.class) {
                if (instance == null) {
                    instance = new ImsConnectorUtils();
                }
            }
        }
        return instance;
    }


    /**
     * 发送数据
     *
     * @param ventilationData
     * @param productCallback
     */
    public void preciseVentilation(String[] ventilationData, ProductCallback productCallback) {
        try {
            imsConnector.leftContinuousVentilation(ventilationData, productCallback);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
